#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

class Solution {
public:

    bool IsContinuous(vector<int>& numbers)
    {
        sort(numbers.begin(), numbers.end());
        int ns = 0;
        for (int i = 0; i < numbers.size(); i++)
        {
            if (numbers[i] == 0)
            {
                ns++;
            }
            else
            {
                if (i != 0 && numbers[i - 1] != 0)
                {
                    if (numbers[i] == numbers[i - 1]) return false;
                    int num = numbers[i] - numbers[i - 1] - 1;
                    ns -= num;
                }
            }
        }
        if (ns < 0) return false;
        else return true;
    }
};

int main()
{
    Solution s;
    vector<int> n = { 1,0,0,1,0 };
    cout<< s.IsContinuous(n);
    return 0;
}

//int main()
//{
//    string s;
//    cin >> s;
//
//    string ret;
//    int n = s.size();
//    for (int i = 0; i < n; i++)
//    {
//        ret += s[i];
//        if ((n - i - 1) % 3 == 0 && i != n - 1) ret += ',';
//    }
//    cout << ret << endl;
//    return 0;
//}